<template>
  <!-- 主页内容组件 -->
  <div class="homeList">
    <div class="container-fluid">
      <div class="row" >
        <div class="jumbotron col-12 shadow mb-0 mb-md-3" v-for="(v, k) in this.$store.state.homeListData">
          <h2 class="">{{v.title}}</h2>
          <p class="theText lead">{{v.desc}}</p>
            <hr class="my-4">
          <p>{{v.master}}</p>
          <p class="theText lead">
            <router-link to="/details">
              <button class="btn btn-primary btn-lg" @click="toTarget(v.target)">See more</button>
            </router-link>
          </p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'HomeList',
    mounted() {
      //获取首页介绍分类信息
      this.$store.dispatch('asynGetHomeListData');
    },
    methods: {
      toTarget(target) {
        // console.log(target);
         sessionStorage.setItem('titleName', target);
      }
    },
  }

</script>

<style scoped>
  .theText {
    font-size: 1.5em;
  }
  @media (max-width: 575px) {
    .theText {
      font-size: 1em;
    }
  }
</style>